#include <stdio.h>


unsigned int LongSwap (unsigned int i)
{
  return i;
  unsigned char b1, b2, b3, b4;

  b1 = i & 255;
  b2 = ( i >> 8 ) & 255;
  b3 = ( i>>16 ) & 255;
  b4 = ( i>>24 ) & 255;

  return ((int)b1 << 24) + ((int)b2 << 16) + ((int)b3 << 8) + b4;
}


int main() {
  int w=256,h=128;
  unsigned long d[w*h*3];
  FILE *f=fopen("earth.rgb","rb");
  fread(d,w*h*3,1,f);
  for(int i=0;i<h*3;i++) {
    for(int j=0;j<w;j+=4) {
      printf("0x%08lX,",LongSwap(d[j/4+i*w/4]));
      if((j&15)==12) puts("\r");
    }
    puts("\r");
  }
}

